# Contributor: Fabian Affolter <fabian@affolter-engineering.ch>
# Maintainer: Fabian Affolter <fabian@affolter-engineering.ch>
pkgname=py3-blockdiag
_pkgname=blockdiag
pkgver=3.0.0
pkgrel=4
pkgdesc="Generate block-diagram image file from spec-text file"
url="http://blockdiag.com"
arch="noarch"
license="Apache-2.0"
depends="py3-funcparserlib py3-pillow py3-webcolors"
makedepends="py3-setuptools py3-gpep517 py3-wheel"
subpackages="$pkgname-tests $pkgname-pyc"
source="https://files.pythonhosted.org/packages/source/${_pkgname:0:1}/$_pkgname/$_pkgname-$pkgver.tar.gz"
builddir="$srcdir"/$_pkgname-$pkgver

replaces="py-blockdiag"                  # for backwards compatibility
provides="py-blockdiag=$pkgver-r$pkgrel" # for backwards compatibility

build() {
	gpep517 build-wheel \
		--wheel-dir .dist \
		--output-fd 3 3>&1 >&2
}

package() {
	gpep517 install-wheel --destdir "$pkgdir" \
		.dist/*.whl
}

tests() {
	amove usr/lib/python3*/site-packages/blockdiag/tests
}

sha512sums="
e0e588941c5212a924068cc0b3953b670089e33c385ea8ce52fc54f5ca79414fb12217eba1052c5384c9f2fd81e79304639c9604cdc4a6464f7c221bb67ef267  blockdiag-3.0.0.tar.gz
"
